package com.resto.scm.web.config;

import cn.restoplus.rpc.client.RpcProxy;
import com.resto.brand.web.service.*;

import com.resto.scm.web.datasource.DynamicDataSource;
import com.resto.shop.web.service.ArticleService;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

import javax.annotation.Resource;

@Configurable
@ImportResource({"classpath:applicationContext.xml"})
@Resource
public class ScmServerConfig {

    @Resource
    RpcProxy proxy;

    @Bean
    public DatabaseConfigService databaseConfigService(){

        return proxy.create(DatabaseConfigService.class);
    }

    @Bean
    public DynamicDataSource dataSource(){
        return new DynamicDataSource();
    }

    @Bean
    public ArticleService articleService(){

        return proxy.create(ArticleService.class);
    }







}
